package com.shreecon.lms.interfaces.manager;

import com.shreecon.lms.interfaces.IMessageConstant;
import com.shreecon.lms.interfaces.LMSException;

public class LeaveManagerFactory {
	
	/** The Constant _instance. */
	private static final LeaveManagerFactory _instance = new LeaveManagerFactory();
	
	/**
 * Instantiates a new employee manager factory.
 */
	private LeaveManagerFactory() {
		
	}
	
	/**
 * Gets the single instance of LeaveManagerFactory.
 * 
 * @return single instance of LeaveManagerFactory
 */
	public static final LeaveManagerFactory getInstance() {
		return _instance;
	}
	
	/**
     * Gets the leave manager.
     * 
     * @return the leave manager
     * @throws LMSException
     *             the lMS exception
     */
	public ILeaveManager getLeaveManager() throws LMSException {
		try {
			return (ILeaveManager)Class.forName("com.shreecon.lms.manager.LeaveManager").newInstance();
		} catch (InstantiationException e) {
			e.printStackTrace();
			throw new LMSException(IMessageConstant.TECH_ERROR, e);
		} catch (IllegalAccessException e) {
			e.printStackTrace();
			throw new LMSException(IMessageConstant.TECH_ERROR, e);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
			throw new LMSException(IMessageConstant.TECH_ERROR, e);
		}
	}

}
